//
//  UITableView+Category.m
//  TLUIKit
//
//  Created by c on 2021/11/5.
//

#import "UITableView+Category.h"
#import "MJRefresh.h"

@implementation UITableView (Category)

- (void)addRefreshHeaderView:(void (^)(void))block {
    MJRefreshNormalHeader *headerView = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
        if (block) {
            block();
        }
    }];
    
    // 设置字体
    headerView.stateLabel.font = [UIFont systemFontOfSize:15];
    headerView.lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:14];
    headerView.stateLabel.textColor             = [UIColor grayColor];
    headerView.lastUpdatedTimeLabel.textColor   = [UIColor grayColor];
    self.mj_header = headerView;
}

- (void)addRefreshFooterView:(void (^)(void))block {
    self.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
        if (block) {
            block();
        }
    }];
}

@end
